package com.kingdee.eas.minghua.contract.app;

import org.apache.log4j.Logger;
import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;

import java.lang.String;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.framework.CoreBaseCollection;
import com.kingdee.eas.minghua.contract.BcxyDocCollection;
import com.kingdee.eas.minghua.contract.BcxyDocFactory;
import com.kingdee.eas.framework.SystemEnum;
import com.kingdee.eas.minghua.contract.BcxyDocInfo;
import com.kingdee.eas.minghua.jczlwh.mj.SfshEnum;
import com.kingdee.eas.minghua.material.ClzfsqdFactory;
import com.kingdee.eas.minghua.material.ClzfsqdInfo;
import com.kingdee.eas.framework.CoreBillBaseCollection;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.framework.app.CoreBillBaseControllerBean;
import com.kingdee.eas.framework.ObjectBaseCollection;

public class BcxyDocControllerBean extends AbstractBcxyDocControllerBean
{
    private static Logger logger =
        Logger.getLogger("com.kingdee.eas.minghua.contract.app.BcxyDocControllerBean");

	protected boolean _pass(Context ctx, String BosID) throws BOSException {
		boolean flag = false; 
		try {
			BcxyDocInfo bcxyInfo = BcxyDocFactory.getLocalInstance(ctx).getBcxyDocInfo(new ObjectUuidPK(BosID));
//			if(!bcxyInfo.getDjzt().equals(SfshEnum.yes)||bcxyInfo.getDjzt()==null){
//				bcxyInfo.setDjzt(SfshEnum.yes);
//				BcxyDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(BosID), bcxyInfo);
//				flag = true;
//			}
			
			bcxyInfo.setDjzt(SfshEnum.yes);
			BcxyDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(BosID), bcxyInfo);
			flag = true;
			
		} catch (EASBizException e) {
			e.printStackTrace();
		}
		return flag;
	}

	protected boolean _reject(Context ctx, String BosID) throws BOSException {
		boolean flag = false;
		try {
			BcxyDocInfo bcxyInfo = BcxyDocFactory.getLocalInstance(ctx).getBcxyDocInfo(new ObjectUuidPK(BosID));
//			if(bcxyInfo.getDjzt().equals(SfshEnum.no)||bcxyInfo.getDjzt().equals(SfshEnum.not)||bcxyInfo.getDjzt()==null){
//				bcxyInfo.setDjzt(SfshEnum.no);
//				BcxyDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(BosID), bcxyInfo);
//				flag = false;
//			}
			
			bcxyInfo.setDjzt(SfshEnum.no);
			BcxyDocFactory.getLocalInstance(ctx).update(new ObjectUuidPK(BosID), bcxyInfo);
			flag = false;
			
		} catch (EASBizException e) {
			e.printStackTrace();
		}
		return flag;
	}
    
}